<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style//css/reset.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style//css/transaction/add_form.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/css/patrol/project_device_alert.css">
</script>
<div>
    <div class="layui-form " style="padding: 50px;" lay-filter="layuiadmin-form" id="layuiadmin-form">
        <div class="layui-table-box" style="padding: 50px;">
            <div class="layui-table-title">
                创建信息变更工单信息
            </div>
            <ul class="layui-row ">
                <li class="layui-col-md4 layui-col-sm4">
                    <div class="form layui-form-item">
                        <label class="layui-label-inlineblock layui-form-label"><span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>工单名称：</label>
                        <div class="layui-input-block">
                            <input type="text" name="tcReqName" autocomplete="off" class="layui-input" lay-verify="required">
                        </div>
                    </div>
                    <div class="form layui-form-item">
                        <label class="layui-label-inlineblock layui-form-label"
                            style="padding-left: 8px;">OA申请编号：</label>
                        <div class="layui-input-block">
                        </div>
                    </div>
                    <div class="form layui-form-item">
                        <label class="layui-label-inlineblock layui-form-label"><span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>设备所属公司：</label>
                        <div class="layui-input-block tcReqCoorig">
                            <select id="tcReqCoorig" name="tcReqCoorig" placeholder="请选择设备所属公司" lay-search
                                lay-verify="required" lay-filter="company">
                            </select>
                        </div>
                    </div>
                </li>
                <li class="layui-col-md4 layui-col-sm4">
                    <div class="form layui-form-item">
                        <label>工单编号：</label>
                        <div class="layui-input-block" id="bianhao" style='display: flex;align-items: center;'>
                        </div>
                    </div>
                    <div class="form layui-form-item">
                        <label class=" layui-label-inlineblock   layui-form-label">工单状态：</label>
                        <div class="layui-input-block" style='display: flex;align-items: center;'>
                            未提交
                        </div>
                    </div>
                </li>
                <li class="layui-col-md4 layui-col-sm4">
                    <div class="form layui-form-item">
                        <label class="layui-label-inlineblock  layui-form-label">*申请人：</label>
                        <div id="gen01" class="layui-input-block"></div>
                    </div>
                    <div class="form layui-form-item">
                        <label class="layui-label-inlineblock layui-form-label">申请日期：<span id="time"></span></label>
                        <div class="layui-input-block">
                        </div>
                    </div>
                </li>
            </ul>
            <div class="layui-table-box">
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label"><span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>信息变更说明:</label>
                    <div class="layui-input-block">
                        <textarea name="fil21" placeholder="请输入 信息变更说明" class="layui-textarea" lay-verify="required"></textarea>
                    </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label"><span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>备注：</label>
                    <div class="layui-input-block">
                        <textarea name="fil07" placeholder="请输入备注" class="layui-textarea" lay-verify="required"></textarea>
                    </div>
                </div>
            </div>
        </div>
        <div class="title-btn layui-btn-containner">
            <button class="add layui-btn layui-btn-radius layui-btn-primary">
                <i class="add-icon layui-icon layui-icon-add-circle" style="font-size: 15px;"></i>
                <span class="btn-inner">添加设备</span>
            </button>
            <!-- 批量修改 -->
            <button class="add2 layui-btn layui-btn-xs layui-btn-radius layui-btn-primary"
                style="background:#4C96CF;line-height: 0px;color:#fff">
                <i class="add-icon layui-icon layui-icon-edit" style="font-size: 15px;"></i>
                <span class="btn-inner">批量修改</span>
            </button>
            <span style="margin-left: 40px;"><i style="color: red;">温馨提示:</i>保存状态信息变更说明和备注可不填</span>
        </div>
        <div class="layui-card-body"></div>
        <table class="layui-table" lay-size="sm" id="baseTable">
            <thead>   
                <tr>
                  <th>序号</th>
                  <th>操作</th>
                  <th>设备名称</th>
                 <th>原资产编号</th>
                 <th>原负责部门</th>
                 <th>原保管人</th>
                 <th>原设备调机人</th>
                 <th>原设备位置</th>
                 <th>新资产编号</th>
                 <th>新负责部门</th>
                 <th>新保管人</th>
                 <th>新设备调机人</th>
                 <th>新设备位置</th>   
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
        <div class="footer layui-btn-containner">
            <button class="commit layui-btn layui-btn-radius layui-btn-primary" lay-submit
                lay-filter="LAY-submit-tj">提交</button>
            <button class="hold layui-btn layui-btn-radius layui-btn-primary" lay-submit
                lay-filter="LAY-submit-bc">保存</button>
            <button class="cancel layui-btn layui-btn-radius layui-btn-primary" lay-filter="LAY-submit-qx">取消</button>
        </div>
    </div>
</div>
<!-- 巡检设备选择 -->
<script type="text/html" id="addDeviceTpl">
    <div class="leon-style-alert">
        <div class="layui-alert-box">
            <div class="layui-alert-title">
                <span class="layui-title-inner">信息变更添加设备选择</span>
                <span class="layui-title-screen">
                    <div class="screen-btn">
                        <form class="layui-form" action="">
                            <input type="search" name="keyWord" class="search-blank-inner searchInput"
                                placeholder="搜索" autocomplete="off"/>
                            <button type="button" lay-submit lay-filter="queryTableDeviceHeader"
                                class="search-blank-icon"></button>
                        </form>
                    </div>
                </span>
            </div>
            <div class="layui-content">
                <div class="con1 toggle-btn">
                    <span class="screen">
                        <i class="query-icon  layui-icon"></i>
                        <span class="query-inner">查询条件</span>
                    </span>
                    <i class="icon layui-icon layui-icon-down"></i>
                </div>
                <div class="con2 toggle-content">
                    <form action="" class="layui-form">
                        <label for="">设备编号:</label>
                        <input type="text" name="fia01" />
                        <label for="">设备名称:</label>
                        <input type="text" name="fia02" />
                        <label for="">供应商:</label>
                        <input type="text" name="fia09" />
                        <button type="button" lay-submit lay-filter="queryTableDevice"
                            class="query layui-btn layui-btn-radius layui-btn-primary">
                            <span class="search-icon"></span>
                            <span class="btn-inner">查询</span>
                        </button>
                    </form>
                </div>
                <table class="layui-table" id="table-device-alert"></table>
            </div>
            <div class="footer layui-btn-containner">
                <button class="btn1 layui-btn layui-btn-radius layui-btn-primary">添加</button>
                <button class="btn2 layui-btn layui-btn-radius layui-btn-primary">取消</button>
            </div>
        </div>
    </div>
</script>
<script>
    var shuju = {
        devAlts: []
    }
    var devAlt = {
    }
    var trindex = 0
    layui.use(['form', 'table', 'api', 'utill', 'laydate', 'jquery'], function () { //此段代码必不可少
        var table = layui.table,
            setter = layui.setter,
            laytpl = layui.laytpl,
            api = layui.api,
            utill = layui.utill,
            form = layui.form,
            admin = layui.admin,
            view = layui.view,
            element = layui.element,
            form = layui.form,
            $ = layui.jquery,
            laydate = layui.laydate;
            function tcReq() {
            admin.req({
                url: api.host + api.AzpSelectAllAzp1,
                type: "POST",
                done: function (res) {
                    $('#tcReqCoalt').empty();
                    $('#tcReqCoorig').empty();
                    var str = '<option value=""></option>'
                    for (let index = 0; index < res.data.length; index++) {

                        str = str +
                            `<option value="${res.data[index].azp01}">${res.data[index].azp02}</option>`
                    }
                    $('#tcReqCoalt').html(str)
                    $('#tcReqCoorig').html(str)
                    form.render(null, 'layuiadmin-form');
                }
            });
        }
        tcReq()
        form.render(null, 'layuiadmin-form');
        $('[data-jump="transaction/paymentAccount"]').addClass('layui-this').attr('color', '#FFF');
        form.on('submit(LAY-submit-bc)', function (data) {
            var field = data.field
            shuju.fil01 = $('#bianhao').html()
            shuju.fil07 = field.fil07
            shuju.fil08 = $('#gen01').html().split('-')[1]
            shuju.fil21 = field.fil21
            shuju.tcReqName = field.tcReqName
            for (let index = 0; index < shuju.devAlts.length; index++) {
                shuju.devAlts[index].tcDetailFia01 = shuju.devAlts[index].fia01
                shuju.devAlts[index].tcDetailFia03 = shuju.devAlts[index].fia03
                shuju.devAlts[index].tcDetailFia09 = shuju.devAlts[index].pmc01
                shuju.devAlts[index].tcDetailFia05 = shuju.devAlts[index].fii02
            }
            bc(JSON.stringify(shuju))
        })
        $('.layui-form').on('click', '.cancel', function () {
            location.hash = '/transaction/paymentAccount'
        })
        form.on('submit(LAY-submit-tj)', function (data) {
            var field = data.field
            shuju.fil01 = $('#bianhao').html()
            shuju.fil07 = field.fil07
            shuju.fil08 = $('#gen01').html().split('-')[1]
            shuju.fil21 = field.fil21
            shuju.tcReqName = field.tcReqName
            for (let index = 0; index < shuju.devAlts.length; index++) {
                shuju.devAlts[index].tcDetailFia03 = shuju.devAlts[index].fia03
                shuju.devAlts[index].tcDetailFia01 = shuju.devAlts[index].fia01
                shuju.devAlts[index].tcDetailFia09 = shuju.devAlts[index].pmc01
                shuju.devAlts[index].tcDetailFia04 = shuju.devAlts[index].tcSeriesId
                shuju.devAlts[index].tcDetailFia05 = shuju.devAlts[index].fii02
            }
            tj(JSON.stringify(shuju))

        })
        function tj(data1) {
            admin.req({
                url: api.host + api.devsendBGOA,
                type: "post",
                data: data1,
                dataType: 'json',
                contentType: 'application/json',
                done: function (res) {
                    location.hash = '/transaction/paymentAccount'
                }
            });
        }
        function bc(data1) {
            admin.req({
                url: api.host + api.devinsertdoc,
                type: "post",
                data: data1,
                dataType: 'json',
                contentType: 'application/json',
                done: function (res) {
                    // 完成后回到信息变更页面
                    location.hash = '/transaction/paymentAccount'
                }
            });
        }
        document.getElementById('time').innerHTML = utill.timestampToTime(new Date())
        admin.req({
            url: api.host + api.AzpSelectAllAzp,
            type: "POST",
            done: function (res) {
                var str = '<option value=""></option>'
                for (let index = 0; index < res.data.length; index++) {

                    str = str +
                        `<option value="${res.data[index].azp01}">${res.data[index].azp02}</option>`
                }
                $('#azp02').html(str)
                form.render(null, 'layuiadmin-form');
            }
        });
        admin.req({
            url: api.host + api.GetFil01_llp,
            data: {
                type: 'BG'
            },
            done: function (res) {

                $('#bianhao').html(res.data.str);
                $('#gen01').html(res.data.gen02);

            }
        });
        $('#baseTable').on('click', '.table-delete', function () {

            var index = $(this).parents('div').parents('td').parents('tr').index()
            shuju.devAlts.splice(index, 1);
            $('#baseTable').find('> tbody tr').eq(index).remove();
        });
        $('#baseTable').on('click', '.table-edit', function () {
            trindex = $(this).parents('div').parents('td').parents('tr').index()
            sessionStorage.setItem('fia01', shuju.devAlts[trindex].fia01)
            admin.popup({
                title: '编辑设备信息',
                area: ['800px', '620px'],
                id: 'LAY-popup-content-tags',
                success: function (layero, index) {
                    view(this.id).render('transaction/branch-four/from')
                        .done(function () {
                            //监听提交
                            form.on('submit(LAY-submit)', function (data) {
                                var field = data.field; //获取提交的字段
                                shuju.devAlts[trindex].tcDetailFia01 = field.fia01
                                shuju.devAlts[trindex].tcDetailFia02 = field.fia02
                                shuju.devAlts[trindex].tcDetailFia11 = field
                                    .tcDetailFia11.split("/")[1].replace(/\s+/g,
                                        "")
                                shuju.devAlts[trindex].tcDetailFia10 = field
                                    .tcDetailFia10.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.devAlts[trindex].tcDetailFia14 = field
                                    .tcDetailFia14.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.devAlts[trindex].tcDetailFia16 = field
                                    .tcDetailFia16.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.devAlts[trindex].tcDetailFia15 = field
                                    .tcDetailFia15.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.devAlts[trindex].tcDetailFia17 = field
                                    .tcDetailFia17.split("/")[0].replace(/\s+/g,
                                        "")
                                shuju.devAlts[trindex].tcDetailFia011 = field
                                    .tcDetailFia011.replace(/\s+/g, "")
                                shuju.devAlts[trindex].tcDetailFiauser = field
                                    .tcDetailFiauser.split("/")[0].replace(
                                        /\s+/g, "")

                                field.tcDetailFia11 = field
                                    .tcDetailFia11.split("/")[0]
                                field.tcDetailFia10 = field
                                    .tcDetailFia10.split("/")[1]
                                field.tcDetailFia14 = field
                                    .tcDetailFia14.split("/")[1]
                                field.tcDetailFia16 = field
                                    .tcDetailFia16.split("/")[1]
                                field.tcDetailFia15 = field
                                    .tcDetailFia15.split("/")[1]
                                field.tcDetailFia17 = field
                                    .tcDetailFia17.split("/")[1]

                                field.tcDetailFiauser = field.tcDetailFiauser
                                    .split("/")[1]

                                var str = `
                       <td>
                         <input type="checkbox" class='xuan'">
                         </td>
                         <td>
                       <div style='display:flex' > <span class="table-edit"  ></span>
                       <span  class="table-delete" ></span></div>
                         </td>
                        <td>${field.fia02}</td>
                        <td>${field.fia011}</td>
                        <td>${field.gem02}</td>
                        <td>${field.keeper}</td>
                        <td>${field.fiauser}</td>
                        <td>${field.tcFtyName}${field.tcFlrName}${field.tcProcName}${field.tcLineName}</td>
                        <td>${field.tcDetailFia011}</td>
                        <td>${field.tcDetailFia11}</td>
                        <td>${field.tcDetailFia10}</td>
                        <td>${field.tcDetailFiauser}</td>
                        <td>${field.tcDetailFia14}${field.tcDetailFia15}${field.tcDetailFia16}${field.tcDetailFia17}</td>
                        `

                                $('#baseTable').find('> tbody')
                                    .find('tr').eq(trindex)
                                    .html(str)
                                layer.close(index); //执行关闭 

                                form.render()
                            });
                            $(".cancel").click(function () {
                                layer.close(index);
                            })
                        });
                }
            });

        });
        let tcReqCoorig = $('#tcReqCoorig').val();
        form.on('select(company)', function(data){
            if(data.value != ''){
                // $('#tcReqCoorig').attr('disabled','disabled');
                form.render('select')
                tcReqCoorig = data.value;
                sessionStorage.setItem('val',data.value);
            }
        });        
        $('.title-btn').on('click', '.add', function (e) {
            if(!$('#tcReqCoorig').val()){
                layer.msg('请先选择设备所属公司！')
                return false
            }
            layer.open({
                type: 1,
                title: false,
                area: ['662px', '536px'],
                fixed: true,
                shadeClose: true,
                closeBtn: 0,
                content: $('#addDeviceTpl').html(),
                success: alertEvent.addDevice
            });
        })
        // 批量修改
        $('.title-btn').on('click', '.add2', function (e) {
            var isarr = [];//定义一个数组    
            $('input[name="chk"]:checked').each(function () {//遍历每一个名字为nodes的复选框，其中选中的执行函数    
                isarr.push($(this).val());//将选中的值添加到数组chk_value中    
            });
            if (isarr.length == 0) {
                layer.msg("请至少勾一条数据")
            } else {
                admin.popup({
                    title: '编辑设备信息',
                    area: ['500px', '500px'],
                    id: 'LAY-popup-content-tags',
                    success: function (layero, index) {
                        view(this.id).render('transaction/branch-four/form3').done(function (data) {
                            // 拿到复选框的
                            //监听提交
                            form.on('submit(LAY-submit)', function (data) {
                                var chk_value = [];//定义一个数组    
                                $('input[name="chk"]:checked').each(function () {//遍历每一个名字为nodes的复选框，其中选中的执行函数    
                                    chk_value.push($(this).val());//将选中的值添加到数组chk_value中    
                                });
                                var field = data.field; //获取提交的字段
                                var data = {
                                }
                                data.tcDetailFia11 = field.tcDetailFia11.split("/")[1].replace(/\s+/g, "")
                                data.tcDetailFia10 = field.tcDetailFia10.split("/")[0].replace(/\s+/g, "")
                                data.tcDetailFia14 = field.tcDetailFia14
                                    .split("/")[0].replace(/\s+/g, "")
                                data.tcDetailFia16 =
                                    field
                                        .tcDetailFia16.split("/")[0]
                                        .replace(/\s+/g,
                                            "")
                                data.tcDetailFia15 =
                                    field
                                        .tcDetailFia15.split("/")[0]
                                        .replace(/\s+/g,
                                            "")
                                data.tcDetailFia17 =
                                    field
                                        .tcDetailFia17.split("/")[0]
                                        .replace(/\s+/g,
                                            "")
                                data.tcDetailFia011 =
                                    field
                                        .tcDetailFia011.replace(/\s+/g, "")
                                data.tcDetailFiauser =
                                    field
                                        .tcDetailFiauser.split("/")[0]
                                        .replace(
                                            /\s+/g, "")
                                var str = ''
                                chk_value.forEach(function (item, index) {
                                    str = `<td>${data.tcDetailFia011}</td>
                                       <td>`+ field.tcDetailFia11.split("/")[0].replace(/\s+/g, "") + `</td>
                                        <td>`+ field.tcDetailFia10.split("/")[1].replace(/\s+/g, "") + `</td>
                                        <td>`+ field
                                            .tcDetailFiauser.split("/")[1]
                                            .replace(
                                                /\s+/g, "") + `</td>
                                       <td>`+ field.tcDetailFia14.split("/")[1].replace(/\s+/g, "") + field.tcDetailFia15.split("/")[1].replace(/\s+/g, "") + field.tcDetailFia16.split("/")[1].replace(/\s+/g, "") + field.tcDetailFia17.split("/")[1].replace(/\s+/g, "") + `</td>`
                                    $("." + item).append(str);
                                })
                                devAlt.tcDetailFia011 = data.tcDetailFia011
                                devAlt.tcDetailFia11 = data.tcDetailFia11
                                devAlt.tcDetailFia10 = data.tcDetailFia10
                                devAlt.tcDetailFiauser = data.tcDetailFiauser
                                devAlt.tcDetailFia14 = data.tcDetailFia14
                                devAlt.tcDetailFia15 = data.tcDetailFia15
                                devAlt.tcDetailFia16 = data.tcDetailFia16
                                devAlt.tcDetailFia17 = data.tcDetailFia17
                                devAlt.check = chk_value
                                for (let index = 0; index < shuju.devAlts.length; index++) {
                                    shuju.devAlts[index].tcDetailFia01 = shuju.devAlts[index].fia01
                                    shuju.devAlts[index].tcDetailFia03 = shuju.devAlts[index].fia03
                                    shuju.devAlts[index].tcDetailFia09 = shuju.devAlts[index].pmc01
                                    //shuju.devAlts[index].tcDetailFia04 = shuju.devAlts[index].tcSeriesId
                                    shuju.devAlts[index].tcDetailFia05 = shuju.devAlts[index].fii02
                                    for (let i = 0; i < devAlt.check.length; i++) {
                                        if (shuju.devAlts[index].fia01 == devAlt.check[i]) {
                                            shuju.devAlts[index] = $.extend({}, shuju.devAlts[index], devAlt)
                                        }
                                    }
                                }
                                layer.close(index);
                            });
                            // 取消关闭
                            $(".cancel").click(function () {
                                layer.close(index);
                            })
                        });
                    }
                });
            }
        })
        var alertEvent = {
            addDevice: function (layero, index) {
                table.render({
                    elem: '#table-device-alert',
                    id: "#table-device-alert",
                    height: 300,
                    skin: 'nob',
                    loading: true,
                    method: 'POST',
                    toolbar: '',
                    headers: {
                        'token': layui.sessionData(setter.tableName).token
                    },
                    cols: [
                        [{
                            type: 'checkbox',
                            width: 20
                        },
                        {
                            field: 'fia01',
                            title: '设备编号'
                        },
                        {
                            field: 'fia02',
                            title: '设备名称'
                        },
                        {
                            field: 'fic02',
                            title: '设备类型'
                        },
                        {
                            field: 'pmc081',
                            title: '供应商'
                        },
                        {
                            field: 'tcSeriesName',
                            title: '设备系列'
                        },
                        {
                            field: 'fii02',
                            title: '设备型号'
                        }
                        ]
                    ],
                    url: api.host + api.FilFileDBSelectFiaFiles1,
                    request: {
                        pageName: 'pageNum',
                        limitName: 'pageSize',
                    },
                    page: {
                        layout: ['prev', 'page', 'next', 'skip'],
                        limits: [10, 20, 30, 50],
                        theme: '#1E9FFF'
                    },
                    parseData: function (res) { //res 即为原始返回的数据
                        return {
                            "code": res.code, //解析接口状态
                            "msg": res.message, //解析提示文本
                            "count": res.data.total, //解析数据长度
                            "data": res.data.list //解析数据列表
                        };
                    },
                    contentType: 'application/json',
                    where: {
                        fia01: "",
                        fia02: "",
                        fia09: "",
                        keyWord: "",
                        tcReqCoorig: $('#tcReqCoorig').val(),
                    }
                });
                utill.keyup('.searchInput', '.search-blank-icon');
                form.on('submit(queryTableDeviceHeader)', function (data) {
                    var allData = data.field;
                    table.reload('#table-device-alert', {
                        where: allData,
                    });
                    return false;
                })
                form.on('submit(queryTableDevice)', function (data) {
                    var allData = data.field;
                    table.reload('#table-device-alert', {
                        where: allData,
                    });
                    return false;
                })
                $('body').off('click', '.footer').on('click', '.footer', function (e) {
                    var $target = $(e.target);
                    if ($target.hasClass('btn1')) {
                        $('#tcReqCoorig').attr('disabled','disabled');
                        var checkedArr = table.checkStatus('#table-device-alert').data;
                        checkedArr.forEach(function (item, index) {
                            for (let index = 0; index < shuju.devAlts.length; index++) {
                                if (shuju.devAlts[index].fia01 == item.fia01) {
                                    layer.msg('请勿重复添加设备')
                                    return
                                }
                            }
                            item.tcDetailFil01 = $('#bianhao').html()
                            var TPL = `<tr class=${item.fia01}>
                                       <td>
                                        <input type="checkbox" class='xuan' value=${item.fia01} name='chk'>
                                       </td>
                                      <td >
                                        <div style='display:flex' > <span class="table-edit"  ></span>
                                        <span  class="table-delete" ></span></div>
                                        </td>
                                        fia02
                                        <td>${item.fia02}</td>
                                        <td>${item.fia011}</td>
                                        <td>${item.gem02}</td>
                                        <td>${item.gen02}</td>
                                        <td>${item.gfiauser}</td>
                                        <td>${item.tcFtyName}${item.tcFlrName}${item.tcProcName}${item.tcLineName}</td>
                                    </tr>`;
                            $('#baseTable').find('> tbody').append(TPL);
                            shuju.devAlts.push(item)
                        })
                        form.render();
                        layer.closeAll()
                    } else if ($target.hasClass('btn2')) {
                        layer.closeAll()
                    }
                });
            }
        }
        // 下拉查询列表
        $('body').off('click', '.toggle-btn').on('click', '.toggle-btn', function () {
            if ($('.toggle-content').hasClass('toggle-content-on')) {
                $('.toggle-content').removeClass('toggle-content-on');
                $(this).find('.layui-icon-up').addClass('layui-icon-down').removeClass('layui-icon-up')
            } else {
                $('.toggle-content').addClass('toggle-content-on');
                $(this).find('.layui-icon-down').addClass('layui-icon-up').removeClass('layui-icon-down')
            }
        })
    });
</script>